<?php

require_once 'httper.php';

$urls = array( 'http://www.php.net', 'http://www.phpnull.net', 'http://www.phpnonexists.net');

foreach ( $urls as $url ) {
    $httper = new Httper();
    $response = $httper->get($url);

    if (is_array($response)) {
        foreach ($response as $name => $value) {
            echo "Response Array : ",$name,"-->(size:",strlen($value),")\n";
        }
    }
    elseif (is_object($response)) {
        foreach ((array)$response as $name => $value) {
            echo "Response Object : ",$name,"-->(size:",strlen($value),")\n";
            if ( strlen($value) < 10 ) {
                var_dump($value);
            }
        }
    }
    else {
        var_dump($response);
        if ( false === $response ) {
            echo $httper->error(),"\n";
        }
    }
}

echo '---------------------------------------------------------',"\n";

$httper = new Httper();
$responses = $httper->mget($urls, 1);
var_dump($responses);

